import { getToken, removeToken, setToken } from "@/utils/auth"
import { getInfo } from "@/api/user"

const state = {
  routes: [],
  addRoutes: [],
  buttonList: [],
  routeLen: 0
}

const mutations = {
  SET_BUTTON: (state, buttonList) => {
    state.buttonList = buttonList
  }
}

const actions = {
  // user logout
  logout: ({ commit, state }) => {
    return new Promise((resolve, reject) => {
      // removeToken()
      sessionStorage.clear()
      resolve()
    })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
